export const res = {

    end(data: any) {

        if (data === null) return new Response(data);

        const type = typeof data;

        if (Array.isArray(data)) {

            return new Response(JSON.stringify(data));

        } else if (type === "object") {

            return new Response(JSON.stringify(data));

        } else {

            return new Response(data);

        }

    }

};

export type Res = typeof res;